import request from './request';

// 获取所有软件
export function getAllSoftware() {
  return request.get('/software');
}

// 获取单个软件详情
export function getSoftwareById(id) {
  return request.get(`/software/${id}`);
}

// 上传软件
export function uploadSoftware(data) {
  return request.post('/software', data);
}

// 更新软件
export function updateSoftware(id, data) {
  return request.put(`/software/${id}`, data);
}

// 下载软件
export function downloadSoftware(id) {
  return request.get(`/software/download/${id}`, {
    responseType: 'blob' // 设置响应类型为blob，用于文件下载
  });
}

// 删除软件
export function deleteSoftware(id) {
  return request.delete(`/software/${id}`);
}